<p id="notice"><%= notice %></p>

<p>
  <b>Title:</b>
  <%= @product.title %>
</p>

<p>
  <b>Description:</b>
  <%= @product.description %>
</p>

<p>
  <b>Image url:</b>
  <%= @product.image_url %>
</p>

<p>
  <b>Price:</b>
  <%= @product.price %>
</p>

 
<!--------------------- #C ------------------------------>
<h2>Comments</h2>
<% @product.comments.each do |comment| %>
  <p>
    <b>Commenter:</b>
    <%= comment.commenter %>
  </p>
 
  <p>
    <b>Comment:</b>
    <%= comment.body %>
  </p>
<% end %>

<!-------------------------------------------------------->
 <p>
  <b>Comments:</b>
  <%= render @product.comments %>
</p>

<!-------------------------------------------------------->

<p id="notice"><%= notice %></p>
  
<!--------------------- #C ------------------------------>
<h2>Add a comment:</h2>
<%= form_for([@product, @product.comments.build]) do |f| %>
  <div class="field">
    <%= f.label :commenter %><br />
    <%= f.text_field :commenter %>
  </div>
  <div class="field">
    <%= f.label :body %><br />
    <%= f.text_area :body %>
  </div>
  <div class="actions">
    <%= f.submit %>
  </div>
<% end %>
<!-------------------------------------------------------->

 
<%= link_to 'Edit', edit_product_path(@product) %> |
<%= link_to 'Back', products_path %>
